<!--- process VALUE --->
<cfset config.checkedValue = parent.processValue('checkValue',caller,attributes,config)/>

<!--- CFPARAM the "maybe" missing variables --->
<cfif structKeyExists(config,'valueList')>
	<cfparam name="config.optionList" default="#config.valueList#"/>
	<cfparam name="config.valueDelimiters" default=","/>
	<cfparam name="config.delimiters" default="#config.valueDelimiters#"/>
<cfelseif structKeyExists(config,'optionList')>
	<cfparam name="config.valueList" default="#config.optionList#"/>
	<cfparam name="config.delimiters" default=","/>
	<cfparam name="config.valueDelimiters" default="#config.delimiters#"/>
<cfelseif structKeyExists(config,'valueArray')>
	<cfparam name="config.optionArray" default="#config.valueArray#"/>
<cfelseif structKeyExists(config,'optionArray')>
	<cfparam name="config.valueArray" default="#config.optionArray#"/>
<cfelseif structKeyExists(config,'value')>
	<cfparam name="config.option" default="#config.value#"/>
<cfelseif structKeyExists(config,'option')>
	<cfparam name="config.value" default="#config.option#"/>
</cfif>

<!--- Map the variables to its caller scope --->
<cfif structKeyExists(config,'list')>
	<cfparam name="config.delimiters" default=","/>
	<cfparam name="config.valueDelimiters" default=":"/>
	<cfset config.list = parent.exists(config.list,caller,false)/>
	<cfif listlen(config.list,config.delimiters) gt 1 and not findOneOf("'""", config.list)>
		<cfset parent.showException(tag,'LIST is a string.  Please wrap quotes around it to treat it as string.',3,attributeCombination)/>			
	</cfif>

<cfelseif structKeyExists(config,'valueList') and structKeyExists(config,'optionList')>
	<cfset config.valueList = parent.exists(config.valueList,caller,false)/>
	<cfset config.optionList = parent.exists(config.optionList,caller,false)/>
		
	<cfif listlen(config.valueList,config.delimiters) gt 1 and not findOneOf("'""", config.valueList)>
		<cfset parent.showException(tag,'VALUELIST is a string.  Please wrap quotes around it to treat it as string.',3,attributeCombination)/>
	</cfif>
	<cfif (listlen(config.optionList,config.valueDelimiters) gt 1 and not findOneOf("'""", config.optionList))>
		<cfset parent.showException(tag,'OPTIONLIST is a string.  Please wrap quotes around it to treat it as string.',3,attributeCombination)/>
	</cfif>
	
	<cfset config.valueList = evaluate(config.valueList)/>
	<cfset config.optionList = evaluate(config.optionList)/>

	<cfif listLen(config.valueList) neq listLen(config.optionList)>
		<cfset parent.showException(tag,'The lists in VALUELIST and OPTIONLIST must be of the same length.',3,attributeCombination)/>
	</cfif>

<cfelseif structKeyExists(config,'array')>
	<cfset config.array = parent.exists(config.array,caller)/>

<cfelseif structKeyExists(config,'valueArray') and structKeyExists(config,'optionArray')>
	<cfset config.valueArray = parent.exists(config.valueArray,caller)/>
	<cfset config.optionArray = parent.exists(config.optionArray,caller)/>

	<cfif arrayLen(config.valueArray) neq arrayLen(config.optionArray)>
		<cfset parent.showException(tag,'The arrays in VALUEARRAY and OPTIONARRAY must be of the same length.',3,attributeCombination)/>
	</cfif>

<cfelseif structKeyExists(config,'query')>
	<cfset config.query = parent.exists(config.query,caller)/>

<cfelseif structKeyExists(config,'table')>
	<cfif listLen(config.option,'&') gt 1 and not structKeyExists(config,'columnList')>
		<cfset parent.showException(tag,'COLUMNLIST must be used with TABLE to merge columns in the OPTION attribute.',3,attributeCombination)/>
	</cfif>
	<cfparam name="config.sort" default="#trim(listFirst(config.option,'&'))#"/>
	<cfparam name="config.order" default="asc"/>
	<cftry>
		<cfquery datasource="#config.dsn#" name="config.query">
			SELECT
				#CONFIG.VALUE#,
				<cfif structKeyExists(config,'columns')>
				#CONFIG.COLUMNS#
				<cfelse>
				#CONFIG.OPTION#
				</cfif>
			FROM
				#CONFIG.TABLE#
			ORDER BY
				#CONFIG.SORT# <cfif listlen(trim(config.sort),' ') eq 1>#CONFIG.ORDER#</cfif>
		</cfquery>	
		<cfcatch type="any">
			<cfset parent.showException(tag,'Having difficulties accessing #ucase(config.table)# table. Make sure the table and all columns exist.',3,attributeCombination)/>		
		</cfcatch>
	</cftry>
</cfif>
<cfif tag eq "checkbox" and (structKeyExists(config,'width') OR structKeyExists(config,'height'))>
	<cfparam name="config.size" default="1"/>
<cfelse>
	<cfparam name="config.size" default="0"/>
</cfif>
<cfif trim(config.size) eq "all" OR config.size lt 0>
	<cfset config.size = 0/>
</cfif>
<cfloop from="1" to="#config.size#" index="i">
	<cfparam name="config.class#tag##i#" default="#tag##i#"/>
</cfloop>

<cfif config.css and (parent.config[tag].size lt config.size)>
	<cfset parent.config[tag].size = config.size/>		
</cfif>